#ifndef INCLUDED_jax_lang_JAutoClosable
#define INCLUDED_jax_lang_JAutoClosable

#ifndef HXCPP_H
#include <hxcpp.h>
#endif

HX_DECLARE_CLASS2(jax,lang,JAutoClosable)
namespace jax{
namespace lang{


class JAutoClosable_obj : public hx::Interface{
	public:
		typedef hx::Interface super;
		typedef JAutoClosable_obj OBJ_;
		HX_DO_INTERFACE_RTTI;
virtual Void close( )=0;
		Dynamic close_dyn();
};

#define DELEGATE_jax_lang_JAutoClosable \
virtual Void close( ) { return mDelegate->close();}  \
virtual Dynamic close_dyn() { return mDelegate->close_dyn();}  \


template<typename IMPL>
class JAutoClosable_delegate_ : public JAutoClosable_obj
{
	protected:
		IMPL *mDelegate;
	public:
		JAutoClosable_delegate_(IMPL *inDelegate) : mDelegate(inDelegate) {}
		hx::Object *__GetRealObject() { return mDelegate; }
		void __Visit(HX_VISIT_PARAMS) { HX_VISIT_OBJECT(mDelegate); }
		DELEGATE_jax_lang_JAutoClosable
};

} // end namespace jax
} // end namespace lang

#endif /* INCLUDED_jax_lang_JAutoClosable */ 
